However, I always get errors about missing close brackets or quotations. I understand the code itself has formatting that may clash with AHK, so is there a way to strictly store a long block of text as a string, or other alternative solutions?
A snippet of my code is shown below, this is one that complains about no closing quotes:
Code: Select all
f1::
{
temp := clipboardall
clipboard := "import argparse
import base64
import json
import re
import socket
import sys
import time
from google.cloud import pubsub_v1
# def receive_messages_with_custom_attributes(project_id, subscription_name):
# """Receives messages from a pull subscription."""
# # [START pubsub_subscriber_sync_pull_custom_attributes]
# import time
#
# from google.cloud import pubsub_v1
#
# project_id = "sdfsdf"
# subscription_name = "asr243"
#
# subscriber = pubsub_v1.SubscriberClient()
# subscription_path = subscriber.subscription_path(
# project_id, subscription_name)
#
# def callback(message):
# print('Received message: {}'.format(message.data))
# if message.attributes:
# print('Attributes:')
# for key in message.attributes:
# value = message.attributes.get(key)
# print('{}: {}'.format(key, value))
# message.ack()
#
# subscriber.subscribe(subscription_path, callback=callback)
#
# # The subscriber is non-blocking, so we must keep the main thread from
# # exiting to allow it to process messages in the background.
# print('Listening for messages on {}'.format(subscription_path))
# while True:
# time.sleep(60)
# # [END pubsub_subscriber_sync_pull_custom_attributes]
###############################################################################
import subprocess
)"
sendinput, ^v
clipboard := temp
}
return
F7::
Clipboard := pasteContent
Send, ^V
Clipboard :=
return